package com.zkw.dao;

import com.zkw.domain.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface BookDao extends JpaRepository<Book,Integer> {

    @Modifying
    @Transactional
    @Query("update tbl_book c set c.description=?1 where c.id=?2")
    int updateBook(String description, Integer id);
}
